/**
*  \file control_buzzer.c
*
*  \brief
*
*  \author
*
*
*/

/*===============================================[ private includes  ]================================================*/
#include "u2c_dataexchange.h"
#include "../assertor/assertor.h"
#include "../pal/pal_mem.h"
#include "../app/app.h"
#include "../mcu/mcu.h"
#include "../input/input.h"
#include "../output/output.h"
#include "../cancom/cancom.h"

/*===============================================[ private defines   ]================================================*/

/*===============================================[ private datatypes ]================================================*/

/*===============================================[ private variables ]================================================*/


/*===============================================[ private functions ]================================================*/

/*================================================[ inline functions ]================================================*/

/*================================================[ public functions ]================================================*/
RC u2c_dataexchange_initialize( void )
{
   return RC_SUCCESS;
}

BO u2c_dataexchange_10ms(void)
{

	/*vehicle pdo 1*/
	u2c_data_output.vehicle_steer_angle_v             = 0;//input_data.steer.angle;
	u2c_data_output.vehicle_park_brake_in_v           = mcu_get_input(EN_PARK_BRAKE_IN_D_CPU_V);
	u2c_data_output.vehicle_neutral_position_v        = mcu_get_input(EN_NEUTRAL_POSITION_IN_D_CPU_V);
	u2c_data_output.vehicle_reverse_in_v              = mcu_get_input(EN_REVERSE_IN_D_CPU_V);
	u2c_data_output.vehicle_forward_in_v              = mcu_get_input(EN_FORWARD_IN_D_CPU_V);
	u2c_data_output.vehicle_option_pedal_v            = input_data.pedal_type;
	u2c_data_output.vehicle_option_steerAngleSensor_v = input_data.steer_sensor_type;
	u2c_data_output.vehicle_inv2_enable_v             = output_data.inverter_2_enable;
	u2c_data_output.vehicle_inv1_enable_v             = output_data.inverter_1_enable;
	u2c_data_output.vehicle_seat_switch_in_v          = mcu_get_input(EN_SEAT_SWITCH_IN_D_CPU_V);
	u2c_data_output.vehicle_seat_switch_nc_in_v       = mcu_get_input(EN_SEAT_SWITCH_NC_IN_D_CPU_V);


	/*vehicle pdo 2*/
    u2c_data_output.vehicle_accelerator_v             = 0;
	u2c_data_output.vehicle_dc_link_in_v              = input_data.adc_voltage[mcu_adc_DcLink];


	/*vehicle pdo 3*/
    u2c_data_output.vehicle_traction_motor_speed_v    = input_data.motor_speed;
	u2c_data_output.vehicle_current_sensors_vol_v     = input_data.adc_voltage[mcu_adc_5VExtSns];   /*5v*/


	/*vehicle pdo 4*/
	u2c_data_output.vehicle_power_supply_v            = input_data.adc_voltage[mcu_adc_13_7VSupply];
	u2c_data_output.vehicle_key_switch_in_v           = input_data.adc_voltage[mcu_adc_KeySwitch];

    
	return TRUE;
}


/*===============================================[ private functions ]================================================*/


/***********************************************************************************************************************
*                             Copyright 2020 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/

